import axios from "~/axios"

export function image_class(page){
    return axios.get('/admin/image_class/'+page)
}

//增加图库分类
export function addImageType(data){
    return axios.post('/admin/image_class',data)
}

//修改图库分类
export function editImageType(id,data){
    return axios.post('/admin/image_class/'+id,data)
}

//删除图库分类
export function deleteImageType(id){
    return axios.post(`admin/image_class/${id}/delete`)
}

//指定分类下的图片列表
export function getImageList(id,page=1){
    return axios.get(`/admin/image_class/${id}/image/${page}`)
}

//上传图片
export const UploadImg = '/api/admin/image/upload'
//修改图片名称
export function editImg(id,name){
    return axios.post(`/admin/image/${id}`,{name})
}
//删除图片
export function deleteImg(ids){
    return axios.post(`/admin/image/delete_all`,{ids})
}